package jsyf.oa.entity.attach;

import com.alibaba.fastjson.JSONObject;

import javax.persistence.Entity;
import javax.persistence.Table;

import jsyf.oa.ientity.BaseEntity;

import java.io.Serializable;

/**
 * Created by Administrator on 2017/11/23 0023.
 */
@Entity
@Table(name = "T_ATTACH_MODULE", schema = "oa", catalog = "")
public class AttachModuleEntity extends BaseEntity  implements Serializable {
    private String id;
    private String attachId;
    /**
     * 附件类型:
     * 1-邮件
     * 2-用户
     * 3-用款申请
     * 4-临时事项
     * 5-样机管理
     */
    private Integer attachModule;
    private String moduleId;

    public AttachModuleEntity() {
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getAttachId() {
        return attachId;
    }

    public void setAttachId(String attachId) {
        this.attachId = attachId;
    }

    public Integer getAttachModule() {
        return attachModule;
    }

    public void setAttachModule(Integer attachModule) {
        this.attachModule = attachModule;
    }

    public String getModuleId() {
        return moduleId;
    }

    public void setModuleId(String moduleId) {
        this.moduleId = moduleId;
    }


    public JSONObject getJSONObject() {
        JSONObject obj = new JSONObject();
        obj.put("ID", getId());
        obj.put("ATTACH_ID", getAttachId());
        obj.put("ATTACH_MODULE", getAttachModule());
        obj.put("MODULE_ID", getModuleId());
        return obj;
    }

    public JSONObject getJSONObjectId() {
        JSONObject obj = new JSONObject();
        obj.put("id", getId());
        return obj;
    }

    @Override
    public String getTableName() {
        return "T_ATTACH_MODULE";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("ATTACH_ID", "attachId");
        obj.put("ATTACH_MODULE", "attachModule");
        obj.put("MODULE_ID", "moduleId");
        return obj;
    }
}
